package com.xing.config;

import com.xing.exception.BusInessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @version 1.0
 * @Author Xing
 * @Date 2024/7/14 10:06
 * @deprecated 全局异常抛出
 */
@RestControllerAdvice
@Slf4j
@Configuration
public class GlobalExceptionHandler {
//    @ExceptionHandler(RuntimeException.class)
//    public Result RunTimeExceptionHandler(RuntimeException e) {
//        log.error("系统异常：{}", e);
//        return new Result().err(Code.ERROR_ID.ordinal());
//    }
//
//    @ExceptionHandler(BusInessException.class)
//    public Result BusinssExceptionHandler(BusInessException e) {
//        log.error("系统异常：{}", e);
//        return new Result().err(Code.WARNING_ID.ordinal());
//    }
}
